<script lang="ts" setup>
import * as ArcoIcons from '@arco-design/web-vue/es/icon'
import { RandomTool } from '@es-tool/core'
import { computed } from 'vue'

const mapping = computed(() =>
        Object.entries(ArcoIcons)
                .filter(([ key ]) => key !== 'default')
                .reduce((mapping, [ key, value ]) => {
                    mapping[key] = value
                    return mapping
                }, {} as Record<string, any>))


</script>

<template>
<div class="select-arco-icon">
    <div v-for="([_, value]) in Object.entries(mapping)" class="icon-wrapper">
        <component :is="value" :rotate="RandomTool.randomNumberMax(0, 365)" :spin="false" />
    </div>
</div>
</template>

<style lang="scss" scoped>
.select-arco-icon {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;

    .icon-wrapper {
        flex: 0 0 auto;
        width: 70px;
        height: 70px;
        margin: 10px;
        padding: 10px;
        box-sizing: border-box;
        cursor: pointer;
    }

    .icon-wrapper:hover {
        border: 1px solid color-mix(in srgb, var(--color-bg-2), transparent 20%);
        border-radius: 5px;
    }

    svg {
        font-size: 50px;
    }
}
</style>
